package com.shoppingmall.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.shoppingmall.R;
import com.shoppingmall.bean.TabBean;

import java.util.List;

public class TabAdepter extends CommonAdapter<TabBean> {


    private Context mContext;
    private int select=0;
    private List<Integer> list;


    public void setSelects(int select){
        this.select=select;
        notifyDataSetChanged();

    }


    public TabAdepter(Context context, int layoutId, List<TabBean> datas,List<Integer> list){
        super(context,layoutId, datas);
        mContext=context;
        this.list=list;
    }



    @Override
    public void convert(ViewHolder holder, TabBean tabBean, int position) {
        holder.setText(R.id.name, tabBean.getName());
        if (list.get(position)==1) {
            ((TextView) holder.getView(R.id.name)).setTextColor(mContext.getResources().getColor(R.color.hei));
            ((TextView) holder.getView(R.id.name)).setTextSize(17);
            ((View) holder.getView(R.id.sezhi)).setBackgroundColor(mContext.getResources().getColor(R.color.hongses));
        } else {
            ((TextView) holder.getView(R.id.name)).setTextColor(mContext.getResources().getColor(R.color.hui));
            ((TextView) holder.getView(R.id.name)).setTextSize(14);
            ((View) holder.getView(R.id.sezhi)).setBackgroundColor(mContext.getResources().getColor(R.color.white));
        }

    }
}
